package favicon

import (
	_ "embed"
	"github.com/zachary/tbox/internal/svc"
	"github.com/zeromicro/go-zero/rest"
	"net/http"
)

//go:embed favicon.ico
var favicon []byte

func GetNoAuthRoutes(serverCtx *svc.ServiceContext) []rest.Route {
	return []rest.Route{
		{
			Method: http.MethodGet,
			Path:   "/favicon.ico",
			Handler: func(writer http.ResponseWriter, request *http.Request) {
				_, err := writer.Write(favicon)
				if err != nil {
					return
				}
			},
		},
	}
}
